/**
 * Copyright (C) 2011 Andrew C. Love (DNC) <dnc.app.sup@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.dnc.cloak.framework.report;

import java.io.Serializable;
import java.util.Map;

import com.dnc.cloak.framework.model.AbstractModel;

public class ReportRequest extends AbstractModel implements Serializable {

    private String reportTemplate;
    private Map <String,Object>parameters;
    private String reportName;
    private String reportLocation;
    private byte[] reportResponse;

    public ReportRequest() {
    }

    @Override
    public String toString() {

        StringBuffer buffer = new StringBuffer();
        if (reportName!=null) {
            buffer.append("reportName:" + reportName + "\n");
        }
        else {
            buffer.append("reportName:" + "null" + "\n");
        }

        if (reportLocation!=null) {
            buffer.append("reportLocation:" + reportLocation + "\n");
        }
        else {
            buffer.append("reportLocation:" + "null" + "\n");
        }

        if (reportTemplate!=null) {
            buffer.append("reportTemplate:" + reportTemplate + "\n");
        }
        else {
            buffer.append("reportTemplate:" + "null" + "\n");
        }

        if (parameters !=null) {
            for (String key : parameters.keySet()) {
                Object value = parameters.get(key);
                buffer.append(key + ":" + value + "\n");
            }
        }
        else {
            buffer.append("parameters:" + "null" + "\n");
        }

        return buffer.toString();

    }

    public synchronized String getReportLocation() {
        return reportLocation;
    }

    public synchronized void setReportLocation(String reportLocation) {
        this.reportLocation = reportLocation;
    }

    public synchronized String getReportName() {
        return reportName;
    }

    public synchronized void setReportName(String reportName) {
        this.reportName = reportName;
    }

    public synchronized Map<String, Object> getParameters() {
        return parameters;
    }

    public synchronized void setParameters(Map<String, Object> parameters) {
        this.parameters = parameters;
    }

    public synchronized String getReportTemplate() {
        return reportTemplate;
    }

    public synchronized void setReportTemplate(String reportTemplate) {
        this.reportTemplate = reportTemplate;
    }

    public byte[] getReportResponse() {
        return reportResponse;
    }

    public void setReportResponse(byte[] reportResponse) {
        this.reportResponse = reportResponse;
    }

}